package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/9/13 5:32
 */
public interface GoodsEnum {


    /**
     * 商品状态
     */
    @AllArgsConstructor
    @Getter
    enum ItemStatus {
        OFFLINE((byte) 0, "下架"),
        ONLINE((byte) 1, "上架");

        private Byte code;
        private String name;
    }

    /**
     * 子商品状态
     */
    @AllArgsConstructor
    @Getter
    enum SkuStatus {
        OFFLINE((byte) 0, "下架"),
        ONLINE((byte) 1, "上架");
        private Byte code;
        private String name;
    }

    @AllArgsConstructor
    @Getter
    enum ProfitTagetTypeEnum {
        SPU(1, "商品分润"),
        CATEGORY(0, "类目分润"),
        PLATFORM(2, "平台"),
        ;
        private Integer code;
        private String msg;

        public static ProfitTagetTypeEnum tagetTypeEnum(Integer code) {
            for (ProfitTagetTypeEnum tagetTypeEnum : values()) {
                if (tagetTypeEnum.getCode().equals(code)) {
                    return tagetTypeEnum;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    enum ProfitTypeEnum {
        FIXED(1, "固定金额"),
        RATIO(0, "百分比");
        private Integer code;
        private String msg;


        public static ProfitTypeEnum tagetTypeEnum(Integer code) {
            for (ProfitTypeEnum tagetTypeEnum : values()) {
                if (tagetTypeEnum.getCode().equals(code)) {
                    return tagetTypeEnum;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    enum ActivityType {
        RESERVE(0, "预约购"),
        DISCOUNT(1, "满减购"),

        ;

        private Integer code;
        private String name;
    }


    @Getter
    @AllArgsConstructor
    enum AcademyStatusEnum {
        DRAFT(0, "草稿"),
        PASSED(1, "审核通过"),
        REJECTED(2, "审核拒绝"),
        PENDING(3, "待审核"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum AcademySourceEnum {
        CONSOLE(0, "后台发表"),
        APP(1, "用户发表"),
        ;
        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum BargainChopTypeEnum {
        RANDOM(0, "随机金额"),
        FIXED(1, "固定砍价人数"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum BargainActivityStatusEnum {
        PROCESSING(0, "活动进行中"),
        FINISH(1, "活动结束"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum BargainOrderStatusEnum {
        PROCESSING(0, "砍价进行中"),
        SUCCESS(1, "砍价成功"),
        FAILURE(2, "砍价失效"),
        THRESHOLD_BUY(3, "已经到底价可以购买"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum BargainLimitPeriodEnum {
        DAY(1, "天"),
        WEEK(2, "周"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum ActivityPlatformEnum {
        CONSOLE(0, "多典系统后台"),
        MERCHANT(1, "五八马商户"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum CategoryTypeEnum {

        PLATFORM(0, "五八马平台"),
        RETAIL(1, "新零售"),
        ;

        private Integer code;
        private String name;

    }

    @Getter
    @AllArgsConstructor
    enum SkuTypeEnum {
        SINGLE(0, "单规格"),
        MULTIPLE(1, "多规格"),
        ;

        private Integer code;
        private String name;
    }

    /**
     * 商品标签
     */
    @Getter
    @AllArgsConstructor
    enum ItemTagEnum {
        /**
         * 热卖
         */
        HOT_SELL("hotSell", "热卖"),
        /**
         * 打折
         */
        DISCOUNT("discount", "打折"),
        /**
         * 分享赚
         */
        SHARE_EARN("shareEarn", "分享赚"),
        /**
         * 限时购
         */
        LIMITED_TIME_PURCHASE("limitedTimePurchase", "限时购"),
        /**
         * 限购
         */
        LIMITED_BUY("limitedBuy", "限购"),
        ;

        /**
         * 标签代号
         */
        private String code;
        /**
         * 标签名称
         */
        private String name;
    }

    @Getter
    @AllArgsConstructor
    enum WeekEnum {
        MON("Mon", 1),
        TUE("Tue", 2),
        WED("Wed", 3),
        THU("Thu", 4),
        FRI("Fri", 5),
        SAT("Sat", 6),
        SUN("Sun", 7),
        ;

        private String dayOfWeek;
        private Integer code;

        public static Integer getCodeBYDay(String dayOfWeek) {
            for (WeekEnum weekEnum : values()) {
                if (weekEnum.getDayOfWeek().equals(dayOfWeek)) {
                    return weekEnum.getCode();
                }
            }
            return null;
        }

    }

    @Getter
    @AllArgsConstructor
    enum SignEnum {

        ONE(1, "常量1"),
        REISSUE(1, "补签"),
        NOT_REISSUE(0, "非补签"),
        ;

        /**
         * 标签代号
         */
        private Integer code;
        /**
         * 标签名称
         */
        private String name;

    }
}
